package com.ruoyi.system.constants;

import com.ruoyi.common.utils.StringUtils;

import java.util.*;
import java.util.stream.Collectors;

public class CommonConstants {

    //库索引前缀
    public static final String INDEX_PREFIX = "new_standard_all";
    //库索引前缀
    public static final String INDEX_PREFIX_STRUCT = "new_standard_all_struct";
    //库索引前缀
    public static final String OLD_INDEX_PREFIX = "standard_all";
    //排序索引前缀
    public static final String NEW_INDEX_PREFIX = "new_standard_all";
    //碎片化索引前缀
    public static final String FRAG_PREFIX = "frag_";
    //参考文献库代码--固定配置
    public static final String REFERENCE = "systemreference";
    //符合性审查库代码--固定配置
    public static final String REVIEW = "systemreview";
    //法律法规库代码--固定配置
    public static final String LAW = "systemlaw";


    //章节字段前缀
    public static final String SECTION_PREFIX = "section_";
    //目录字段前缀
    public static final String CATA_PREFIX = "cata_";
    //表格字段前缀
    public static final String TABLE_PREFIX = "table_";
    //导航搜索字段后缀
    public static final String _NAV = "_nav";


    //导航搜索 作者
    public static final String AUTHOR = "author";
    //导航搜索 发表时间
    public static final String PUBLISHTIME = "publish_time";
    //导航搜索 知识体系
    public static final String CLASSSYSTEM = "class_system";

    //搜索的公共字段
    public static List<String> searchField = Arrays.asList("a100,a298,a302,a895,a209");

    //搜索的公共字段
    public static List<String> searchFieldExport = Arrays.asList("a298,a302,a895,a209");

    //搜索的公共字段
    public static List<String> tableList = Arrays.asList("aa_n" ,"aacc_n" , "aama_n" , "aami_n" , "aashto_n" , "aatcc_n" , "abma_n" , "abs_n" ,
            "ac_n" , "aci_n" , "acr_n" , "aecma_n" , "aga_n" , "agma_n" , "ahri_n" , "aia_n" , "aiim_n" , "airforce_n" , "aisc_n" , "amca_n" ,
            "ans_n" , "ansi_n" , "aoac_n" , "api_n" , "ari_n" , "arinc_n" , "army_n" , "as_n" , "asa_n" , "asce_n" , "ashrae_n" , "asme_n" ,
            "asprs_n" , "asq_n" , "asrm_n" , "asse_n" , "astm_n" , "atis_n" , "atsc_n" , "aws_n" , "awwa_n" , "bb" , "bhma_n" , "bifma_n" ,
            "bip_n" , "bipm_n" , "bisfa_n" , "boca_n" , "bp_n" , "bs_n" , "cac_n" , "can_n" , "cea_n" , "cecc_n" , "cen_n" ,
            "cenelec_n" , "cgsb_n" , "cie_n" , "cispr_n" , "cns_n" , "cp_n" , "cpsa_n" , "csa_n" , "csma_n" , "cti_n" , "cwa_n" , "cy" ,
            "db11" , "db37" , "dd_n" , "din_n" , "doc_n" , "dod_n" , "dot_n" , "dz" , "eaap_n" , "eca_n" , "ecma_n" , "eia_n" , "en_n" ,
            "epa_n" , "etsi_n" , "fcc_n" , "fd_n" , "ford_n" , "fz" , "ga" , "ga_n" , "gbj" , "geia_n" , "gjb" , "gl_n" , "gm_n" ,
            "gmb_n" , "gme_n" , "gmna_n" , "gmw_n" , "gost_n" , "gpa_n" , "gsa_n" , "gw_n" , "hb" , "hbb" , "hg" , "hhs_n" , "iaea_n" ,
            "iata_n" , "icao_n" , "icc_n" , "icea_n" , "icru_n" , "idf_n" , "iec_n" , "iecq_n" , "ieee_n" , "iesna_n" , "ifoam_n" , "ip_n" ,
            "ipc_n" , "ippc_n" , "isa_n" , "iso_n" , "isuzu_n" , "itu_n" , "iwto_n" , "jas_n" , "jaso_n" , "jb" , "jc" , "jec_n" ,
            "jedec_n" , "jfha_n" , "jg" , "jis_n" , "ks_n" , "ksa_n" , "lr_n" , "mil_n" , "mt" , "mss_n" , "nace_n" , "nasa_n" ,
            "navy_n" , "ndis_n" , "nema_n" , "nf_n" , "nfpa_n" , "niosh_n" , "niso_n" , "nsf_n" , "ny" , "oie_n" , "oiml_n" ,
            "osha_n" , "pas_n" , "pd_n" , "ppi_n" , "pren_n" , "qb" , "qc" , "qj" , "ptb_n" , "rwma_n" , "sabs_n" , "sae_n" ,
            "sb" , "sh" , "sj" , "sn" , "snv_n" , "ss_n" , "sspc_n" , "sy" , "tappi_n" , "tia_n" , "ts_n" , "uic_n" , "ul_n" , "uni_n" ,
            "usda_n" , "ute_n" , "va_n" , "vde_n" , "vdi_n" , "wes_n" , "xp_n" , "yb" , "yc" , "yd", "gb");


    //搜索的公共字段
    public static List<String> tableListPartOne = Arrays.asList("aa_n" ,"aacc_n" , "aama_n" , "aami_n" , "aashto_n" , "aatcc_n" , "abma_n" , "abs_n" ,
            "ac_n" , "aci_n" , "acr_n" , "aecma_n" , "aga_n" , "agma_n" , "ahri_n" , "aia_n" , "aiim_n" , "airforce_n" , "aisc_n" , "amca_n" ,
            "ans_n" , "ansi_n" , "aoac_n" , "api_n" , "ari_n" , "arinc_n" , "army_n" , "as_n" , "asa_n" , "asce_n" , "ashrae_n" , "asme_n" ,
            "asprs_n" , "asq_n" , "asrm_n" , "asse_n" , "astm_n" , "atis_n" , "atsc_n" , "aws_n" , "awwa_n" , "bb" , "bhma_n" , "bifma_n" ,
            "bip_n" , "bipm_n" , "bisfa_n" , "boca_n" , "bp_n" , "bs_n" , "cac_n" , "can_n" , "cea_n" , "cecc_n" , "cen_n" ,
            "cenelec_n" , "cgsb_n" , "cie_n" , "cispr_n" , "cns_n" , "cp_n" , "cpsa_n" , "csa_n" , "csma_n" , "cti_n" , "cwa_n" , "cy" ,
            "db11" , "db37" , "dd_n" , "din_n" , "doc_n" , "dod_n" , "dot_n" , "dz" , "eaap_n" , "eca_n" , "ecma_n" , "eia_n" , "en_n" ,
            "epa_n" , "etsi_n" , "fcc_n" , "fd_n" , "ford_n" , "fz" , "ga" , "ga_n" , "gbj" , "geia_n" , "gjb" , "gl_n" , "gm_n" ,
            "gmb_n" , "gme_n" , "gmna_n" , "gmw_n" , "gost_n" , "gpa_n" , "gsa_n" , "gw_n" , "hb" , "hbb" , "hg" , "hhs_n" , "iaea_n" ,
            "iata_n" , "icao_n" , "icc_n" , "icea_n" , "icru_n" , "idf_n" , "iec_n" , "iecq_n" , "ieee_n" , "iesna_n" , "ifoam_n" , "ip_n" ,
            "ipc_n" , "ippc_n" , "isa_n" , "iso_n" , "isuzu_n" , "itu_n" , "iwto_n" , "jas_n" , "jaso_n" , "jb" , "jc" , "jec_n" ,
            "jedec_n" , "jfha_n" , "jg" , "jis_n" , "ks_n" , "ksa_n" , "lr_n" , "mil_n" , "mt" , "mss_n" , "nace_n" , "nasa_n" ,
            "navy_n" , "ndis_n" , "nema_n" , "nf_n" , "nfpa_n" , "niosh_n" , "niso_n" , "nsf_n" , "ny" , "oie_n" , "oiml_n" ,
            "osha_n" , "pas_n" , "pd_n" , "ppi_n" , "pren_n" , "qb" , "qc" , "qj" , "ptb_n" , "rwma_n" , "sabs_n" , "sae_n" ,
            "sb" , "sh" , "sj" , "sn" , "snv_n" , "ss_n" , "sspc_n" , "sy" , "tappi_n" , "tia_n" , "ts_n" , "uic_n" , "ul_n" , "uni_n" ,
            "usda_n" , "ute_n" , "va_n" , "vde_n" , "vdi_n" , "wes_n" , "xp_n" , "yb" , "yc" , "yd", "gb");


    //搜索的公共字段
    public static List<String> tableListPartTwo = Arrays.asList(  "astm_n" , "atis_n" , "atsc_n" , "aws_n" , "awwa_n" , "bb" , "bhma_n" , "bifma_n" ,
            "bip_n" , "bipm_n" , "bisfa_n" , "boca_n" , "bp_n" , "bs_n" , "cac_n" , "can_n" , "cea_n" , "cecc_n" , "cen_n" ,
            "cenelec_n" , "cgsb_n" , "cie_n" , "cispr_n" , "cns_n" , "cp_n" , "cpsa_n" , "csa_n" , "csma_n" , "cti_n" , "cwa_n" , "cy" ,
            "db11" , "db37" , "dd_n" , "din_n" , "doc_n" , "dod_n" , "dot_n" , "dz" , "eaap_n" , "eca_n" , "ecma_n" , "eia_n" , "en_n" ,
            "epa_n" , "etsi_n" , "fcc_n" , "fd_n" , "ford_n" , "fz" , "ga" , "ga_n" , "gbj" , "geia_n" , "gjb" , "gl_n" , "gm_n" ,
            "gmb_n" , "gme_n" , "gmna_n" , "gmw_n" , "gost_n" , "gpa_n" , "gsa_n" , "gw_n" , "hb" , "hbb" , "hg" , "hhs_n" , "iaea_n" ,
            "iata_n" , "icao_n" , "icc_n" , "icea_n" , "icru_n" , "idf_n" , "iec_n" , "iecq_n" , "ieee_n" , "iesna_n" , "ifoam_n" , "ip_n" ,
            "ipc_n" , "ippc_n" , "isa_n" , "iso_n" , "isuzu_n" , "itu_n" , "iwto_n" , "jas_n" , "jaso_n" , "jb" , "jc" , "jec_n" ,
            "jedec_n" , "jfha_n" , "jg" , "jis_n" , "ks_n" , "ksa_n" , "lr_n" , "mil_n" , "mt" , "mss_n" , "nace_n" , "nasa_n" ,
            "navy_n" , "ndis_n" , "nema_n" , "nf_n" , "nfpa_n" , "niosh_n" , "niso_n" , "nsf_n" , "ny" , "oie_n" , "oiml_n" ,
            "osha_n" , "pas_n" , "pd_n" , "ppi_n" , "pren_n" , "qb" , "qc" , "qj" , "ptb_n" , "rwma_n" , "sabs_n" , "sae_n" ,
            "sb" , "sh" , "sj" , "sn" , "snv_n" , "ss_n" , "sspc_n" , "sy" , "tappi_n" , "tia_n" , "ts_n" , "uic_n" , "ul_n" , "uni_n" ,
            "usda_n" , "ute_n" , "va_n" , "vde_n" , "vdi_n" , "wes_n" , "xp_n" , "yb" , "yc" , "yd", "gb");

    //搜索的公共字段
    public static List<String> tableListPartThree = Arrays.asList(
            "tb","mzb","jjg","jjf","dl","cept_n");

    public static List<String> tableListPartGB = Arrays.asList(
            "gb");


    //搜索的公共字段
    public static List<String> tablePriceList = Arrays.asList("gb");

    //搜索的公共字段
    public static List<String> fileTableList = Arrays.asList("hb" , "hbb" , "hg" , "hhs_n" , "iaea_n" , "iata_n" , "icao_n" , "icc_n"
            , "icea_n" , "icru_n" , "idf_n" , "iec_n" , "iecq_n" , "ieee_n" , "iesna_n" , "ifoam_n" , "ip_n" ,
            "ipc_n" , "ippc_n" , "isa_n" , "iso_n" , "isuzu_n" , "itu_n" , "iwto_n" , "jas_n" , "jaso_n" , "jb" , "jc" , "jec_n" ,
            "jedec_n" , "jfha_n" , "jg" , "jis_n" , "ks_n" , "ksa_n" , "lr_n" , "mil_n" , "mt" , "mss_n" , "nace_n" , "nasa_n" ,
            "navy_n" , "ndis_n" , "nema_n" , "nf_n" , "nfpa_n" , "niosh_n" , "niso_n" , "nsf_n" , "ny" , "oie_n" , "oiml_n" ,
            "osha_n" , "pas_n" , "pd_n" , "ppi_n" , "pren_n" , "qb" , "qc" , "qj" , "ptb_n" , "rwma_n" , "sabs_n" , "sae_n" ,
            "sb" , "sh" , "sj" , "sn" , "snv_n" , "ss_n" , "sspc_n" , "sy" , "tappi_n" , "tia_n" , "ts_n" , "uic_n" , "ul_n" , "uni_n" ,
            "usda_n" , "ute_n" , "va_n" , "vde_n" , "vdi_n" , "wes_n" , "xp_n" , "yb" , "yc" , "yd", "gb");


    public static List<String> fileTableListBak = Arrays.asList("hb" , "hbb" , "hg" , "hhs_n" , "iaea_n" , "iata_n" , "icao_n" , "icc_n"
            , "icea_n" , "icru_n" , "idf_n" , "iec_n" , "iecq_n" , "ieee_n" , "iesna_n" , "ifoam_n" , "ip_n" ,
            "ipc_n" , "ippc_n" , "isa_n" , "iso_n" , "isuzu_n" , "itu_n" , "iwto_n" , "jas_n" , "jaso_n" , "jb" , "jc" , "jec_n" ,
            "jedec_n" , "jfha_n" , "jg" , "jis_n" , "ks_n" , "ksa_n" , "lr_n" , "mil_n" , "mt" , "mss_n" , "nace_n" , "nasa_n" ,
            "navy_n" , "ndis_n" , "nema_n" , "nf_n" , "nfpa_n" , "niosh_n" , "niso_n" , "nsf_n" , "ny" , "oie_n" , "oiml_n" ,
            "osha_n" , "pas_n" , "pd_n" , "ppi_n" , "pren_n" , "qb" , "qc" , "qj" , "ptb_n" , "rwma_n" , "sabs_n" , "sae_n" ,
            "sb" , "sh" , "sj" , "sn" , "snv_n" , "ss_n" , "sspc_n" , "sy" , "tappi_n" , "tia_n" , "ts_n" , "uic_n" , "ul_n" , "uni_n" ,
            "usda_n" , "ute_n" , "va_n" , "vde_n" , "vdi_n" , "wes_n" , "xp_n" , "yb" , "yc" , "yd", "dl","jjf","jjg","tb","gb");

    //行标
    public static String hbStringbak = "AQ,BB,CB,CH,CJ,CY,DA,DB,DL,DY,DZ,EJ,FZ,GA,GC,GF,GH,GM,GY,HB,HG,HJ,HS,HY,JB,JC,JG,JR,JS,JT,JY,KA,LB,LD,LS,LY,MH,MR,MT,MZ,NB,NY,QB,QC,QJ,QX,RB,RF,SB,SC,SF,SH,SJ,SL,SN,SW,SY,TB,TD,TY,WB,WH,WJ,WM,WS,WW,XB,XF,YB,YC,YD,YJ,YS,YY,YZ,ZY";

    public static String hbString = "AQ,BB,CB,CH,CJ,CY,DA,DB,DL,DY,DZ,EJ,FZ,GA,GC,GF,GH,GM,GY,HB,HG,HJ,HS,HY,JB,JC,JG,JR,JS,JT,JY,KA,LB,LD,LS," +
            "LY,MH,MR,MT,MZ,NB,NY,QB,QC,QJ,QX,RB,RF,SB,SC,SF,SH,SJ,SL,SN,SW,SY,TB,TD,TY,WB,WH,WJ,WM,WS,WW,XB,XF,YB,YC,YD,YJ,YS,YY,YZ,ZY,CECS,CEC," +
            "CACM,QGCML,SYMBJY,CNAS,CAS,JGJ,CSTM,SDAS,JJF,CCGF,CEEIA,CASME,CJJ,GXAS,SHDSGY,CSEE,CAB,CF,SHMHZQ,YBB,SSEA,DG,DG,CCSA,CZSPTXH,GDC," +
            "TJ,CESA,CSAE,SPGG,CAQI,GDNB,CECS,CEC,CACM,QGCML,SYMBJY,CNAS,CAS,JGJ,CSTM,SDAS,JJF,CCGF,CEEIA,CASME,CJJ,GXAS,SHDSGY,CSEE,CF," +
            "SHMHZQ,YBB,SSEA,DG,DG,CCSA,CZSPTXH,GDC,TJ,CESA,CSAE,SPGG,CAQI,GDNB,NJ,HBB,NAIA,DBJ,CCPIA,CPCIF,SHZSAQS,ITS,JJG,CASMES,CFA";

    public static String dbString = "DB15,DB37,DB62,DB44,DB64,DB33,DB35,DB11";

    public static String gwString ="ABS,AAMI,AASHTO,AATCC,AACC,AAMA,AA,ABMA,ABS,ACI,ACR,AC,AECMA,AGA,AGMA,AHRI,AIA,AIIM,AIR,AISC,AMCA,ANSI,ANS," +
            "AOAC,API,ARINC,ARI,ARMY,ASA,ASCE,ASHRAE,ASME,ASPRS,ASQ,ASRM,ASSE,ASTM,AS,ATSI,ATSC,AWS,AWWA,BHMA,BIFMA,BIPM,BIP,BISFA,BOCA,BP,BS,CAC," +
            "CAN,CEA,CECC,CENELEC,CEN,CEPT,CGSB,CIE,CISPR,CNS,CPSA,CP,CSA,CSMA,CTI,CWA,DD,DIN,DOC,DOD,DOT,EAAP,ECA,ECMA,EIA,EN,EPA,ETSI,FCC,FD,FORD," +
            "GEIA,GL,GMB,GME,GM,GOST,GPA,GSA,GW,HHS,IAEA,IATA,ICAO,ICC,ICEA,ICRU,IDF,IECQ,IEC,IEEE,IESNA,IFOAM,IPC,IPPC,IP,ISA,ISO,ISUZU,ITU," +
            "IWTO,JASO,JAS,JEC,JEDEC,JFHA,JIS,KSA,KS,LR,MIL,MSS,NACE,NASA,NAVY,NDIS,NEMA,NFPA,NF,NIOSH,NISO,NSF,OIE,OIML,OSHA,PAS,PD,PPI,PREN," +
            "PTB,RWMA,SABS,SAE,SNV,SSPC,SS,TAPPI,TIA,TS,UIC,UL,UNI,USDA,UTE,VA,VDE,VDI,WES,XP,DS,ES,GMNA,ABNT,TCVN,SNI,CEI,PNS,TIS,GMW,DVS,CAA," +
            "DELPHI,CS,ATIS,DVGW,DWA,TAS,VDA,CGA,CI,CLSI,MMS,DNV,ES,GMNA,ABNT,TCVN,SNI,CEI,PNS,TIS,GMW,DVS,CAA,DELPHI,CS,ATIS,DVGW,DWA,TAS," +
            "VDA,CGA,CI,CLSI,MMS,DNV,MS";

//    public static String totalString ="AQ,BB,CB,CH,CJ,CY,DA,DB,DL,DY,DZ,EJ,FZ,GA,GC,GF,GH,GM,GY,HB,HG,HJ,HS,HY,JB,JC,JG,JR,JS,JT,JY,KA,LB,LD,LS," +
//            "LY,MH,MR,MT,MZ,NB,NY,QB,QC,QJ,QX,RB,RF,SB,SC,SF,SH,SJ,SL,SN,SW,SY,TB,TD,TY,WB,WH,WJ,WM,WS,WW,XB,XF,YB,YC,YD,YJ,YS,YY,YZ,ZY,CECS,CEC," +
//            "CACM,QGCML,SYMBJY,CNAS,CAS,JGJ,CSTM,SDAS,JJF,CCGF,CEEIA,CASME,CJJ,GXAS,SHDSGY,CSEE,CAB,CF,SHMHZQ,YBB,SSEA,DG,DG,CCSA,CZSPTXH,GDC," +
//            "TJ,CESA,CSAE,SPGG,CAQI,GDNB,CECS,CEC,CACM,QGCML,SYMBJY,CNAS,CAS,JGJ,CSTM,SDAS,JJF,CCGF,CEEIA,CASME,CJJ,GXAS,SHDSGY,CSEE,CAB,CF," +
//            "SHMHZQ,YBB,SSEA,DG,DG,CCSA,CZSPTXH,GDC,TJ,CESA,CSAE,SPGG,CAQI,GDNB,NJ,HBB,NAIA,DBJ,CCPIA,CPCIF,SHZSAQS,ITS,JJG,CASMES,CFA,"+
//            "DB15,DB37,DB62,DB44,DB64,DB33,DB35,DB11,"+
//            "ABS,AAMI,AASHTO,AATCC,AACC,AAMA,AA,ABMA,ABS,ACI,ACR,AC,AECMA,AGA,AGMA,AHRI,AIA,AIIM,AIR,AISC,AMCA,ANSI,ANS," +
//            "AOAC,API,ARINC,ARI,ARMY,ASA,ASCE,ASHRAE,ASME,ASPRS,ASQ,ASRM,ASSE,ASTM,AS,ATSI,ATSC,AWS,AWWA,BHMA,BIFMA,BIPM,BIP,BISFA,BOCA,BP,BS,CAC," +
//            "CAN,CEA,CECC,CENELEC,CEN,CEPT,CGSB,CIE,CISPR,CNS,CPSA,CP,CSA,CSMA,CTI,CWA,DD,DIN,DOC,DOD,DOT,EAAP,ECA,ECMA,EIA,EN,EPA,ETSI,FCC,FD,FORD," +
//            "GEIA,GL,GMB,GME,GM,GOST,GPA,GSA,GW,HHS,IAEA,IATA,ICAO,ICC,ICEA,ICRU,IDF,IECQ,IEC,IEEE,IESNA,IFOAM,IPC,IPPC,IP,ISA,ISO,ISUZU,ITU," +
//            "IWTO,JASO,JAS,JEC,JEDEC,JFHA,JIS,KSA,KS,LR,MIL,MSS,NACE,NASA,NAVY,NDIS,NEMA,NFPA,NF,NIOSH,NISO,NSF,OIE,OIML,OSHA,PAS,PD,PPI,PREN," +
//            "PTB,RWMA,SABS,SAE,SNV,SSPC,SS,TAPPI,TIA,TS,UIC,UL,UNI,USDA,UTE,VA,VDE,VDI,WES,XP,DS,ES,GMNA,ABNT,TCVN,SNI,CEI,PNS,TIS,GMW,DVS,CAA," +
//            "DELPHI,CS,ATIS,DVGW,DWA,TAS,VDA,CGA,CI,CLSI,MMS,DNV,ES,GMNA,ABNT,TCVN,SNI,CEI,PNS,TIS,GMW,DVS,CAA,DELPHI,CS,ATIS,DVGW,DWA,TAS," +
//            "VDA,CGA,CI,CLSI,MMS,DNV,MS,GB,TB,STANDARD_TB,T/";

    //国标
    public static String gbString = "GB";

    //行标
    public static String tbString = "TB,STANDARD_TB,T/";

    public static String totalString = hbString + "," + gwString + "," + dbString + "," + gbString + "," + tbString;

    // 替换原有totalString定义，通过工具类去重
//    public static String totalString = getDistinctString(hbString + "," + gwString + "," + dbString + "," + gbString + "," + tbString);
//
//    // 新增去重工具方法
//    private static String getDistinctString(String source) {
//        if (StringUtils.isEmpty(source)) {
//            return "";
//        }
//        Set<String> distinctSet = new LinkedHashSet<>(Arrays.asList(source.split(",")));
//        return String.join(",", distinctSet);
//    }


    // 2. 预定义去重后的编码列表（核心优化）
    public static List<String> HB_CODE_LIST = getDistinctCodeList(hbString);
    public static List<String> DB_CODE_LIST = getDistinctCodeList(dbString);
    public static List<String> GW_CODE_LIST = getDistinctCodeList(gwString);
    public static List<String> GB_CODE_LIST = getDistinctCodeList(gbString);
    public static List<String> TB_CODE_LIST = getDistinctCodeList(tbString);
    public static List<String> TOTAL_CODE_LIST = new ArrayList<>();
    static {
        // 合并所有分类的去重列表，避免重复
        TOTAL_CODE_LIST.addAll(HB_CODE_LIST);
        TOTAL_CODE_LIST.addAll(DB_CODE_LIST);
        TOTAL_CODE_LIST.addAll(GW_CODE_LIST);
        TOTAL_CODE_LIST.addAll(GB_CODE_LIST);
        TOTAL_CODE_LIST.addAll(TB_CODE_LIST);
        // 最终去重（确保无跨分类重复）
        TOTAL_CODE_LIST = new ArrayList<>(new LinkedHashSet<>(TOTAL_CODE_LIST));
    }

    // 3. 编码去重工具方法
    private static List<String> getDistinctCodeList(String source) {
        if (StringUtils.isEmpty(source)) {
            return Collections.emptyList();
        }
        return Arrays.stream(source.split(","))
                .map(String::trim)
                .filter(code -> !code.isEmpty())
                .distinct()
                .collect(Collectors.toList());
    }

    // 4. 保留原有字符串（兼容其他调用），但建议后续改用 List
//    public static String totalString = String.join(",", TOTAL_CODE_LIST);

    //地标
//    public static String dbString = "DB";



    //"gb",

    //搜索的公共字段
    public static List<String> dbList = Arrays.asList("DB11","DB37","DB15");
    //搜索的公共字段
    public static List<String> gbList = Arrays.asList("GB","GBJ");

    //搜索的公共字段
    public static String searchFieldA101 = "a101";
    //搜索的公共字段
    public static List<String> searchFieldA101List = Arrays.asList("a101");
    //搜索的公共字段
    public static List<String> searchFieldA100 = Arrays.asList("a100");

    public static List<String> searchFieldA100A298 = Arrays.asList("a100","a298");
    //搜索的公共字段
    public static List<String> searchFieldA298 = Arrays.asList("a298");
    //搜索的公共字段
    public static List<String> searchFieldA302 = Arrays.asList("a302");
    //搜索的公共字段
    public static List<String> searchFieldA895 = Arrays.asList("a895");
    //搜索的公共字段
    public static List<String> searchFieldA209 = Arrays.asList("a209");
    //搜索的公共字段
    public static List<String> searchFieldA825 = Arrays.asList("a825");
    //搜索的公共字段
    public static List<String> searchFieldA826 = Arrays.asList("a826");
    //搜索的公共字段
    public static List<String> searchFieldA200 = Arrays.asList("a200");
    //搜索的公共字段
    public static List<String> searchFieldA850 = Arrays.asList("a850");
    public static List<String> searchFieldFilePath = Arrays.asList("filePath");
    //搜索的公共字段
    public static String searchFieldA850String = "a850";
    public static String searchFieldFilePathString = "filePath";
    //搜索的公共字段
    public static String searchFieldA100String = "a100";

    //导入文档使用的分布式锁key
    public static final String IMPORT_LIBRARY_KEY = "lock:knowledgelibrary";
    //库容量前缀
    public static final String NUM_DATABASE = "num:search:database:";
    //作者容量前缀
    public static final String NUM_AUTHOR = "num:search:author:";
    //分类体系容量前缀
    public static final String NUM_CLASSSYSTEM = "num:search:classsystem:";
    //发表时间容量前缀
    public static final String NUM_PUBLISH = "num:search:publishtime:";


    //用户行为--搜索
    public static final Integer BEHAVIOR_SEARCH = 1;
    //用户行为--收藏
    public static final Integer BEHAVIOR_COLLECT = 2;
    //用户行为--下载
    public static final Integer BEHAVIOR_DOWNLOAD = 3;
    //用户行为--浏览
    public static final Integer BEHAVIOR_BROWSE = 4;


    //用户行为--浏览
    public static final Integer TASK_NOCOMPLETE = 0;

    //用户行为--浏览
    public static final Integer TASK_SUCCESS = 1;

    //用户行为--浏览
    public static final Integer TASK_ERROR = 2;


    //全文搜索字段
    public static final String FULLTEXT = "full_text";

    //关键词搜索字段
    public static final String KEYWORD = "keyword";

    /*碎片化标识位*/
    //待碎片化
    public static final String FRAGE_INI = "-1";
    //碎片化成功
    public static final String FRAGE_YES = "0";
    //未碎片化
    public static final String FRAGE_NO = "1";
    //碎片化进行中
    public static final String FRAGE_ING = "2";
    //碎片化失败
    public static final String FRAGE_FAIL = "3";

}
